package binary;
/** 十六进制演示 */
public class HexDemo {
    /*
    16进制：缩写2进制
    * */

    public static void main(String[] args) {
        int n = 0x2fd47b; //0x表示16进制
        int m = 0b10_1111_1101_0100_0111_1011; //0b表示2进制
        System.out.println(Integer.toBinaryString(n));//1011111101010001111011
        System.out.println(Integer.toBinaryString(m));//1011111101010001111011
        System.out.println(Integer.toHexString(n));//2fd47b
        System.out.println(Integer.toHexString(m));//2fd47b
        System.out.println(n);//3134587
        System.out.println(m);//3134587
        System.out.println(Integer.toBinaryString(Integer.MAX_VALUE));//01111111111111111111111111111111
        System.out.println(Integer.toBinaryString(Integer.MIN_VALUE));//10000000000000000000000000000000
        System.out.println(Integer.toBinaryString(-1));//11111111111111111111111111111111
        System.out.println(Integer.toBinaryString(0));//00000000000000000000000000000000
    }

}
